<template>
  <div>
    <GenTableColumnTable
            ref="TableArea"
            @getTableList="getTableList">
    </GenTableColumnTable>
  </div>
</template>

<script>
  import GenTableColumnTable from "./components/GenTableColumnTable";
  import { mapState } from "vuex";

  export default {
    name: "index",
    computed:{
      ...mapState({
        rootState: state=>state,
        genTableColumnState: state=>state.GenTableColumn
  })
  },
  components: {
    GenTableColumnTable
  },
  created(){ this.getTableList(); },
  methods: {
    getTableList(current) {
      if (current) this.rootState.current = current;
      this.api.post("/genTableColumn/getList?current=" + this.rootState.current + "&size=" + this.rootState.size, this.genTableColumnState.searchForm).then((res) => {
        if (res.code === 200) {
        this.genTableColumnState.tableList = res.data.records;
        console.log(res.data.records)
        this.rootState.total = res.data.total;
        this.$store.dispatch("ROOT_UPDATE_TABLE_HEIGHT", {$}); // 动态设置表格高度
      }
    });
    },
  }
  }

</script>

<style scoped>

</style>
